'use strict';_Ky.browserAction.onClicked.addListener(()=>{_qf("brwrAction","trigActId")(a=>{a&&_Sg?_1w(a):_L()})});_Ky.windows.getLastFocused({populate:!0,windowTypes:_to},a=>{_Pd=_Kg(a,"id");_Ca=_Rh(_Kg(a,"tabs",0)||{})});_Ky.tabs.onCreated.addListener(_Mt);
function _Mt(a){let b=a.id=_Rh(a);_Mh.push(b);_os[b]=a;a.openerTabId&&(_Ne[b]=a.openerTabId,Object.keys(_Ne).length.in(50,75,100,150,200,300)&&_vi(()=>{for(let c in _Ne)(_Ne[c]=_Qy(_os[c],"openerTabId"))||delete _Ne[c];for(let c in _Ne)c in _os||delete _Ne[c]}));a.active||_Aa(b,a.windowId);_sr(_vd,b)}
{let a=_se(400,_Oj);_Ky.tabs.onRemoved.addListener(b=>{b==_Ca&&(_Ca=null);_Aa(b,0);_Mh.remove(b);_Ek.remove(b);delete _jh[b];delete _1t[b];_Ge.push({id:b,time:Date.now()/1E3});a();_sr(_Lr,b);_Nt&&(_Ss[b]=_7j(_os[b]),setTimeout(()=>{delete _Ss[b]},3E3))})}function _ch(a,b,c){b=a.indexOf(b);~b&&(a[b]=c)}function _zi(a,b,c){b in a&&(a[c]=a[b],delete a[b])}let _9i;
_Ky.tabs.onReplaced.addListener((a,b)=>{_So(_Ri,[b,a]);_Ca==b&&(_Ca=a);_ch(_Mh,b,a);_ch(_Ek,b,a);_zi(_os,b,a);_zi(_jh,b,a);_zi(_1t,b,a);_zi(_Ne,b,a);for(let [c,d]of _Ne)d==b&&(_Ne[c]=a);for(let [,c]of _7f)_ch(c,b,a);_9i||(_9i={});_9i[b]=a});
{let a=0;_Ky.tabs.onActivated.addListener(({tabId:b,windowId:c})=>{var d=Date.now()-0;_0o(c,b,d);(d=c==_Pd)&&(_Ca=b);const e=_sk[c];let f=_os[b];f||(f=_os[b]={id:b,windowId:c,window:e});const g=_Hd(e);_Vw[b]&&1E3<Date.now()-a&&(delete _Vw[b],g&&"about:blank"==_7j(f)&&(_So(_Ld,[_fa,_fa|_Go,_Uh,_gf,_gf|_Go,_Uh|_Go,_Us,_Us|_Go]),a=Date.now()));c=_Kg(e,"activeTab","id");e.activeTab=f;_du(b,!d);c!=b&&(_sr(_bs,c),g&&_sr(_vf,c));setTimeout(()=>{_sr(_uw,b);g&&_sr(_5f,b)},80)})}let _ua;
function _xe(a,b){_ua&&(3E3>Math.abs(Date.now()-_ua)&&b.startsWith("https://www.google.com/url?q=")&&(b=decodeURIComponent(b.substr(29)),_rk(a,{code:`location.replace(${JSON.stringify(b)}) ; document.body.style.opacity=0`})()),_ua=0)}
{let a={},b;_Ky.tabs.onUpdated.addListener((c,d)=>{let e="loading"==d.status?_vw:"complete"==d.status?_Qo:d.discarded?_j:d.audible?_8j:!1===d.audible?_ve:0;if(e==_j){if(c==b){b=null;return}b=c}d.url&&(c==_Ca&&_Lh(d.url),_ih(_os,c).url=d.url,_ua&&_xe(c,d.url),_sr(_me,c));if(e){e==_vw&&c in _jh&&(_1t[c]=Date.now(),_Ky.tabs.getZoom(c,f=>{_rt(f,2)!=_jh[c]&&_9w(c,_jh[c],!0)}));if(e==_vw){a[c]=setTimeout(()=>{delete a[c];_sr(e,c)},10);return}if(e==_Qo&&a[c]){clearTimeout(a[c]);return}_sr(e,c)}_Oi&&d.favIconUrl&&
(d=_Tu(_7j(_os[c])),delete _Le[d],_lj(d)(_Qu));e==_Qo&&_gw&&_So(_wr,{tabId:c});e==_Qo&&(new URL(_7j(_os[c]))).hostname==_ik&&_Iu(c)})}
function _Iu(a){_rk(a,{code:`(${(function(b){let c=d=>d&&chrome.runtime.sendMessage({[d.value]:decodeURI(d.closest("a").href)});window._ACtlExt||addEventListener("webSettgs",d=>c(d.target));window._ACtlExt=document.querySelector("ACtlExt")||document.head.appendChild(document.createElement("ACtlExt"));window._ACtlExt.setAttribute("ver",b);c(document.querySelector("a [value=redirSttgs]"))})})(${JSON.stringify("2025.2.8")})`})()}_Ky.tabs.onAttached.addListener((a,b)=>{_ih(_os,a).windowId=b.newWindowId});
_Ky.windows.onFocusChanged.addListener(a=>{_Ba[a]||!_sk[a]&&!_D[a]||(_D[a]&&delete _D[a],_0f([a])())});_Ky.windows.onCreated.addListener(_rr);function _rr(a){a.cTime=Date.now();clearTimeout(_ha);_Zg.push(a.id);_sk[a.id]=a;a.state.in("normal","maximized")&&(a.prevState=a.state);_0f([a.id])();_sr(_Yd,a.id)}_Ky.windows.onRemoved.addListener(_e);function _dt(a){_Zg.remove(a);_tf.remove(a);_m(a,null);delete _sk[a];a==_Pd&&_Ky.windows.getLastFocused({windowTypes:_to},b=>_Pd=_fy()?null:b.id)}
function _e(a){_dt(a);_sr(_vr,a)}_Ky.system.display.onDisplayChanged.addListener(()=>{_8i(()=>_Of())});{let a;_Ky.runtime.onUpdateAvailable.addListener(()=>{_xk(2)&&_Ww(2);a=!0});_Ky.idle.onStateChanged.addListener(b=>{"active"!=b&&setTimeout(()=>_Ky.idle.queryState(60,c=>{"active"!=c&&(a?_Ww(2):!_Ih()&&_ar&&864E5<Date.now()-_ar?_Ww(1):_Gu||_So(_mu))}),1E3*(15*Math.random()+5)|0)})}if(_Ky.sessions){let a=_Ky.sessions.onChanged;a.addListener(_Qu);a.removeListener(_Qu)}
_Ky.contextMenus.onClicked.addListener(_Et(function*(a){if("reloadExtn"==a.menuItemId){a=yield _fw(_te);let b=yield _0k(),c={allWinIds:b.map(d=>d.id),idToHndl:_Ba,hndlToId:_Rk,actionQueue:_fj};a&&!a.actWinMine&&(c.focusedId=(b.filter(d=>d.focused)[0]||{}).id,c.lastFocusId=((yield d=>_Ky.windows.getLastFocused({windowTypes:_to},d))||{}).id,c.focusedId==c.lastFocusId&&(delete c.lastFocusId,_Ba[c.focusedId]==a.focusWin&&delete c.focusedId),c.hijackedWins=Object.keys(_D));_Vg("diagnostics",c.add(a));
_Ww(1,!0)}else a.menuItemId.startsWith("binSwtch")&&_es(a.menuItemId,a.checked)}));_Ky.runtime.onInstalled.addListener(_Et(function*(a){if("update"==a.reason&&"2025.2.8"!=a.previousVersion){yield _2u.wait();let b=yield _3w();b.errorCount=yield _by();_6p("update",b.add({prevVersion:a.previousVersion}));_8u(a.previousVersion,"2021.4.5")}}));_Ky.runtime.onMessageExternal.addListener((a,b,c)=>{b=_Sy.indexOf(b.id);if(0<=b)switch(a){case "TBBtnInit":_ya(b);break;case "TBBtnClick":_sr(_Y+b),c(!0)}});_oo(_2i);
_tl({customEntities:{},LOCAL:{}},_Et(function*({customEntities:a,LOCAL:b}){_Sw(b.localSync);_Ad(b.remoteSync);yield c=>_vi(c);yield c=>_8i(c);_Rd=b.natHostInstalled;b.installTime?(b.installTime<+new Date(2020,2,1)/1E3&&(b.installTime*=1E3),_Dp=b.installTime,_Fg=Math.floor(_Dp/1E3),_Dy=_Te()):(yield _ks({"LOCAL.installTime":_Dp}),_6p("install"));_gy=b.switchStates||{};_Ot=a;_Oe();a=yield _mj(2);b.installTime||_L();_dp();a&&_ud(!0);_By({url:`*://${_ik}/*`})(c=>c.forEach(d=>_Iu(d.id)));_2u.send(a,!0)}));
